package com.liujiahe.controller;


import com.liujiahe.entity.City;
import com.liujiahe.service.ICityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 刘家贺
 * @since 2022-06-30
 */
@RestController
@RequestMapping("/city")
public class CityController {

    @Autowired
    ICityService service;

    // 三级联动
    @RequestMapping("cList")
    public List<City> cList () {
        List<City> tree = service.tree();
        return tree;
    }

}
